<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <%@ include file="/WEB-INF/views/mod2016/include/head.jsp" %>
    <title>报表配置</title>
</head>
<body class="bg-gray">





                        <div class="col-w2 clearfix _isExport" >
                            <div class="col-w2-left fl"><span class="font-red">*</span>是否支持导出：</div>
                            <div class="col-w2-right fl">
                                <input class="inp-radio required" type="radio" name="isExport" value="1" <c:if test="${report.isExport=='1'}">checked="checked"</c:if>><span class="b-radio mgl-10"><b></b>是</span>
                                <input class="inp-radio" type="radio" name="isExport" value="0" <c:if test="${report.isExport=='0'}">checked="checked"</c:if>><span class="b-radio mgl-20"><b></b>否</span>
                            </div>
                        </div>

                        <div class="col-w2 clearfix"  <c:if test="${report.isExport == null || report.isExport=='0'}">style="display: none;"</c:if>>
                            <div class="col-w2-left fl">导出方式：</div>
                            <div class="col-w2-right fl">
                                <input class="inp-radio " type="radio" name="isExportAsyn" value="0" <c:if test="${report.isExportAsyn=='0'}">checked="checked"</c:if>><span class="b-radio mgl-10"><b></b>同步</span>
                                <input class="inp-radio " type="radio" name="isExportAsyn" value="1" <c:if test="${report.isExportAsyn=='1'}">checked="checked"</c:if>><span class="b-radio mgl-20"><b></b>异步</span>
                                <input class="inp-radio " type="radio" name="isExportAsyn" value="2" <c:if test="${report.isExportAsyn=='2'}">checked="checked"</c:if>><span class="b-radio mgl-10"><b></b>都支持</span>
                            </div>
                        </div>
                        <div class="col-w2 clearfix">
                            <div class="col-w2-left fl">报表说明：</div>
                            <div class="col-w2-right fl">
                                <form:input path="reportNote" htmlEscape="false" class="w-input262"/>
                            </div>
                        </div>
                            <div class="col-w2 clearfix">
                                <div class="col-w2-left fl">菜单编码：</div>
                                <div class="col-w2-right fl">
                                    <form:input path="menuCode" htmlEscape="false" class="w-input262" placeholder="用于配置报表的菜单归属"/>
                                </div>
                            </div>
                        <div class="col-w2 clearfix">
                            <div class="col-w2-left fl"><span class="font-red">*</span>查询sql：</div>
                            <div class="col-w2-right fl">
                                <form:textarea path="sqlRef" htmlEscape="false"  class="input-n3 w-input550 h60 required"></form:textarea>
                            </div>
                        </div>
                        <div class="col-w2 clearfix">
                            <div class="col-w2-left fl">储存过程Sql块：</div>
                            <div class="col-w2-right fl">
                                <textarea name="proce" id="proce" class="input-n3 w-input550 h60">${fn:escapeXml(report.proce)}</textarea>
                            </div>
                        </div>
                        <div class="col-w2 clearfix">
                            <div class="col-w2-left fl">储存过程执行频率：</div>
                            <div class="col-w2-right fl">
                                <form:input path="proceCron" htmlEscape="false" maxlength="50" class="w-input262"/>
                            </div>
                        </div>
                        <div class="col-w2 clearfix">
                            <div class="col-w2-left fl"><span class="font-red">*</span>备注：</div>
                            <div class="col-w2-right fl">
                                <form:textarea path="remark" htmlEscape="false" class="input-n3 w-input550 h60 required"
                                               placeholder="请备注该报表各个指标值的sql和指标值之间的关系，方便维护"/>
                            </div>
                        </div>
                        <div class="ac">
                            <shiro:hasPermission name="report:config:edit">
                                <input type="submit" class="btn-yellow" value="保存">
                            </shiro:hasPermission>
                            <a onclick="JavaScript:history.go(-1);" class="btn-gray-outline1 mgl-10 w-input60">返回</a>
                        </div>
                    </div>
                </form:form>
            </div>
        </div>
    </div>
</div>

<div class="loading-box fade in" id="loadingDiv" style="display: none"></div>
<!--遮罩层-->
<div id="backMask" style="display: none"></div>
<script src="${ctxStatic}/plat2016/public/js/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function(){
        $("#inputForm").validate({
            submitHandler: function (form) {
                $("#loadingDiv").show();
                var flag = false;
                $("input[name='isExport']:radio").each(function(){
                    if($(this).attr("checked")){
                        flag = true;
                        return;
                    }
                });
                if(!flag){
                    $("#loadingDiv").hide();
                    alertx("请选择是否支持导出");
                    return;
                }
                form.submit();
            }
        });
        $("input[name='isExport']").on("change", function () {
            var val = $(this).val();
            if (val == '1') {
                $(this).closest(".clearfix").next().show();
            } else {
                $(this).closest(".clearfix").next().hide();
            }
        });
    });
</script>
</body>
</html>